/******************************************************************************
 * GmDebug.cpp - 
 * 
 * Copyright 2011-2016 Guangzhou Timetop Electronics Technology Co.,Ltd.
 * 
 * DESCRIPTION: - 
 *     -
 * modification history
 * 
 * 01a, 11sep2012, Mr. Huanbiao Xie  written
 *
 ******************************************************************************/
#include "GmDebug.h"
#include "stdio.h"

FILE *g_LogStream;  

void InitLog(char * fileName)
{
	g_LogStream = fopen( fileName, "w" ); 
	printf("g_LogStream=%d\n",g_LogStream);
	fprintf(g_LogStream,"InitLog End  g_LogStream=%d\n",g_LogStream);
}
void ExitLog()
{
	fclose( g_LogStream ); 
}

#ifdef WIN32
char * _GetFileName(char * filename) 
{
	char file[256];
	//printf("%s\n",__FILE__);
	char * temp=NULL;
	char* index;
	index=(char*)strstr(filename,ProjectName);
	temp=index;
	while (1)
	{
		index=(char*)strstr(temp+ProjectName_len,ProjectName);
		//printf("::index=%s\n,temp=%s\n",index,temp);
		if (temp!=index&& index!=NULL)
		{
			temp=(char*)index;
		}
		else
		{
			if (*(temp+ProjectName_len)=='.')
			{
				return temp;
			} 
			else
			{
				return (char *)temp+ProjectName_len;
			}
			break;
		}
	}
	return (char *)temp;
}
#endif


